package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WOrderGoodMapper;
import com.ruoyi.system.domain.WOrderGood;
import com.ruoyi.system.service.IWOrderGoodService;

/**
 * 物品Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-05
 */
@Service
public class WOrderGoodServiceImpl implements IWOrderGoodService 
{
    @Autowired
    private WOrderGoodMapper wOrderGoodMapper;

    /**
     * 查询物品
     * 
     * @param id 物品主键
     * @return 物品
     */
    @Override
    public WOrderGood selectWOrderGoodById(Long id)
    {
        return wOrderGoodMapper.selectWOrderGoodById(id);
    }

    /**
     * 查询物品列表
     * 
     * @param wOrderGood 物品
     * @return 物品
     */
    @Override
    public List<WOrderGood> selectWOrderGoodList(WOrderGood wOrderGood)
    {
        return wOrderGoodMapper.selectWOrderGoodList(wOrderGood);
    }

    /**
     * 新增物品
     * 
     * @param wOrderGood 物品
     * @return 结果
     */
    @Override
    public int insertWOrderGood(WOrderGood wOrderGood)
    {
        wOrderGood.setCreateTime(DateUtils.getNowDate());
        return wOrderGoodMapper.insertWOrderGood(wOrderGood);
    }

    /**
     * 修改物品
     * 
     * @param wOrderGood 物品
     * @return 结果
     */
    @Override
    public int updateWOrderGood(WOrderGood wOrderGood)
    {
        wOrderGood.setUpdateTime(DateUtils.getNowDate());
        return wOrderGoodMapper.updateWOrderGood(wOrderGood);
    }

    /**
     * 批量删除物品
     * 
     * @param ids 需要删除的物品主键
     * @return 结果
     */
    @Override
    public int deleteWOrderGoodByIds(Long[] ids)
    {
        return wOrderGoodMapper.deleteWOrderGoodByIds(ids);
    }

    /**
     * 删除物品信息
     * 
     * @param id 物品主键
     * @return 结果
     */
    @Override
    public int deleteWOrderGoodById(Long id)
    {
        return wOrderGoodMapper.deleteWOrderGoodById(id);
    }
}
